<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:include="layout :: htmlhead" th:with="title='流程管理'"></head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <!--头-->
    <div th:replace="fragments/head :: header"></div>

    <div class="layui-body" style="margin: 1%">
        <div class="demoTable">
            &nbsp;&nbsp;流程
        </div>

        <div id="permTable" class="grid">
        </div>
        
	      <form role="form" method="post" action="/workflow/upload"  enctype="multipart/form-data">
	         <div class="layui-form-item">
			    <div class="layui-inline">
			      <label class="layui-form-label">定义名称</label>
			      <div class="layui-input-inline">
			        <input name="filename" id="filename" type="text" class="layui-input" lay-verify="required"/>
			      </div>
			    </div>
			    <div class="layui-inline">
			      <label class="layui-form-label">选择文件</label>
			      <div class="layui-input-inline">
			        <input name="file" id="file" type="file"/>
			      </div>
			    </div>
			    <div class="layui-inline">
			      <div class="layui-input-inline">
			        <input type="submit" class="layui-btn" lay-filter="demo1" value="提交上传"/>
			      </div>
			    </div>
			  </div>
		 </form>
		 
		 部署信息
		 <hr class="layui-bg-cyan"/>

             <table class="layui-table">
                <thead>
                <tr>
                    <th>流程id</th>
                    <th>流程名称</th>
                    <th>发布时间</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <tr th:each="dep: ${depList}">
				<td th:text="${dep?.id}">id</td>
				<td th:text="${dep?.name}">定义名称</td>
				<td th:text="${#dates.format(dep?.deploymentTime,'yyyy-MM-dd HH:mm')}">2000-01-01 10:10</td>
				<td>
                    <a href="/workflow/delete" 
                    th:href="@{/workflow/delete(deploymentId=${dep.id})}"
                    class="layui-btn layui-btn-primary layui-btn-xs">删除</a>
                </td>
				</tr>
                </tbody>
            </table>
            
			流程定义信息
			<hr class="layui-bg-cyan"/>
		    
		    <table class="layui-table">
                <thead>
                <tr>
                    <th>id</th>
                    <th>名称</th>
                    <th>key</th>
                    <th>版本</th>
                    <th>规则文件</th>
                    <th>规则图片</th>
                    <th>部署id</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <tr th:each="pd: ${pdList}">
				<td th:text="${pd?.id}">id</td>
				<td th:text="${pd?.name}">name</td>
				<td th:text="${pd?.key}">key</td>
				<td th:text="${pd?.version}">version</td>
				<td th:text="${pd?.resourceName}">resourceName</td>
				<td th:text="${pd?.diagramResourceName}">diagramResourceName</td>
				<td th:text="${pd?.deploymentId}">deploymentId</td>
				<td>
                    <a href="/workflow/vinit" 
                      th:href="@{/workflow/vinit(deploymentId=${pd.deploymentId},imageName=${pd.diagramResourceName})}"
                    class="layui-btn layui-btn-primary layui-btn-xs" >查看</a>
                </td>
				</tr>
                </tbody>
            </table>
    </div>


    <!--底部-->
    <div th:replace="fragments/footer :: footer"></div>
</div>
</body>
</html>